<!--
 * @Author: TaoLer <alipay_tao@qq.com>
 * @Date: 2021-12-06 16:04:51
 * @LastEditTime: 2022-08-10 16:50:38
 * @LastEditors: TaoLer
 * @Description: 搜索引擎SEO优化设置
 * @FilePath: \github\TaoLer\view\taoler\index\public\base.html
 * Copyright (c) 2020~2025 https://www.aieok.com All rights reserved.
-->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="applicable-device" content="pc,mobile" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta name="renderer" content="webkit" />
	<meta name="force-rendering" content="webkit" />
	<!-- seo -->
	<title>{block name="title"}{taoler:title /}{/block}</title>
	<meta name="keywords" content="{block name='keywords'}{taoler:keywords /}{/block}" />
	<meta name="description" content="{block name='description'}{taoler:description /}{/block}" />
	<meta name="copyright" content="{taoler:copyright /}" />
	{block name="ogtitle"}{/block}
	{block name="ogdescription"} {/block}
	<meta property="og:url" content="{$Request.url}" />
	<meta property="og:site_name" content="{taoler:name /}" />
	{block name="ogimage"} {/block}
	{block name="meta"}{/block}

	<script src="/static/layui/layui.js" charset="utf-8"></script>
	<script src="/static/tpl/taoler/mods/toast.js"></script>
	<script src="/static/common/notify.js"></script>
	<!-- 样式 -->
	<link rel="canonical" href="{$Request.url}">
	<link rel="stylesheet" href="/static/tpl/taoler/css/font_24081_qs69ykjbea.css" />
	<link rel="stylesheet" href="/static/layui/css/layui.css">
	<link rel="stylesheet" href="/static/tpl/taoler/css/global.css">
	<link rel="stylesheet" href="/static/component/pear/css/module/toast.css">
	{block name="link"}{/block}
	<script src="/static/share/plusShare.js" type="text/javascript" charset="utf-8"></script>
	{$sysInfo.showlist|raw}
</head>
<body>
<script>
	const scriptUrl = '/static/layui/layui.js';
	const existingScripts = document.querySelectorAll(`script[src="${scriptUrl}"]`);
	if (existingScripts.length === 0) {
		const script = document.createElement('script');
		script.src = scriptUrl;
		document.body.appendChild(script);
	}
</script>

{include file="public/header" /}
{block name="column"}导航{/block}
{block name="content"}内容{/block}
{include file="public/footer" /}
{include file="public/js" /}

<script>
	var element = layui.element;
	var toast = layui.toast;
	var notify = layui.notify;

	layui.cache.user = {
		username: "{$user.name ?? '游客'}"
		,uid: "{$user.id ?? -1}"
		,avatar: '/static/tpl/taoler/images/avatar/00.jpg'
		,experience: "{$user.point ?? 0}"
		,sex: "{$user.sex ? '女':'男'}"
	};
	
	layui.config({
		version: "3.0.0"
		,base: "/static/tpl/taoler/mods/"
	}).extend({
		fly: 'index'
	}).use('fly');

	$.get("{:url('login_status')}", function(res) {
		if(res.code === 0) {
			var LOGHTML = `<li class="layui-nav-item"><a class="layui-icon layui-icon-username" style="font-size: 20px;" href="{:url('user_login')}"></a></li>
				<li class="layui-nav-item layui-hide-xs"><a href="{:url('user_login')}">{:lang('login')}</a></li>
				<li class="layui-nav-item layui-hide-xs"><a href="{:url('user_reg')}">{:lang('register')}</a></li>
				<li class="layui-nav-item layui-hide-xs layui-hide">
					<select name="language" style="width:50px;" lay-filter="language" lay-verify="" id="language">
						<option value="cn" {if cookie('think_lang') == 'zh-cn'} selected {/if} >{:lang('chinese')}</option>
						<option value="tw" {if cookie('think_lang') == 'zh-tw'} selected {/if} >{:lang('tChinese')}</option>
						<option value="en" {if cookie('think_lang') == 'en-us'} selected {/if} >{:lang('english')}</option>
					</select>
				</li>`;
		} else {
			var LOGHTML = `{if ($Request.action=='user')}
			<li class="layui-nav-item"><a href="/">{:lang('home page')}</a></li>
			{/if}
			<li class="layui-nav-item" lay-unselect>
				<a class="fly-nav-avatar" href="{:url('user/index')}"><cite class="layui-hide-xs">${res.data.name}</cite><img src="${res.data.avatar}"></a>
				<dl class="layui-nav-child">
					<dd><a href="{:url('user/index')}"><i class="layui-icon layui-icon-username"></i>{:lang('user center')}</a></dd>
					<dd><a href="{:url('user/set')}"><i class="layui-icon layui-icon-set"></i>{:lang('set info')}</a></dd>
					<dd><a href="{:url('user/message')}"><i class="iconfont icon-tongzhi"></i>{:lang('my message')}</a></dd>
					<dd><a href="${res.data.user_home}"><i class="layui-icon layui-icon-home"></i>{:lang('my page')}</a></dd>
					<dd><a data-url="{:url('user/logout')}" href="javascript:void(0)" id="logout" style="text-align: center;">{:lang('logout')}</a></dd>
				</dl>
			</li>`;
		}

		$('.fly-nav-user').append(LOGHTML);
		// 渲染导航组件
		element.render('nav', 'header-filter-nav');
	  })

</script>
{block name="script"}{/block}
{:hook('addon_hooks')}
</body>
</html>

